package game.entity;

import game.ability.AbilityManager;
import game.logic.GameControl;
import game.shared.Constants;

import java.util.ArrayList;

public class BufferSpriteManager {
	static ArrayList<AbsSprite>listAbsSprite;
	
	public static void Init(AbilityManager abilityManager, GameControl gameControl, SpriteManager _ArmyManager, SpriteManager _MonsterManager, SpriteManager _WeaponManager) 
	{
		listAbsSprite = new ArrayList<AbsSprite>();		
		listAbsSprite.add(new Army(gameControl, _MonsterManager, "res/img/monster_1.txt"));
		listAbsSprite.add(new Monster(abilityManager, _ArmyManager, "res/img/monster_1.txt"));
		listAbsSprite.get(listAbsSprite.size()-1).setHp(30);
		listAbsSprite.add(new Monster(abilityManager, _ArmyManager, "res/img/monster_2.txt"));
		listAbsSprite.get(listAbsSprite.size()-1).setHp(60);
		listAbsSprite.add(new Monster(abilityManager, _ArmyManager, "res/img/monster_3.txt"));
		listAbsSprite.get(listAbsSprite.size()-1).setHp(100);
		listAbsSprite.add(new Monster(abilityManager, _ArmyManager, "res/img/monster_4.txt"));
		listAbsSprite.get(listAbsSprite.size()-1).setHp(150);
		listAbsSprite.add(new Monster(abilityManager, _ArmyManager, "res/img/monster_5.txt"));
		listAbsSprite.get(listAbsSprite.size()-1).setHp(300);
		listAbsSprite.add(new Monster(abilityManager, _ArmyManager, "res/img/monster_6.txt"));
		listAbsSprite.get(listAbsSprite.size()-1).setHp(500);
		listAbsSprite.add(new Weapon(abilityManager, _WeaponManager, "res/img/rocket_1.txt"));
	}
	
	public static AbsSprite getSpriteBufferByID(int id){
		for(int i=0; i<listAbsSprite.size(); i++)
			if(listAbsSprite.get(i).id == id)
				return listAbsSprite.get(i);
		return null;
	}
	
	public static final int BUFFER_SPRITE_ARMY 			= 0;
	public static final int BUFFER_SPRITE_MONSTER_1		= 1;
	public static final int BUFFER_SPRITE_MONSTER_2		= 2;
	public static final int BUFFER_SPRITE_MONSTER_3		= 3;
	public static final int BUFFER_SPRITE_MONSTER_4		= 4;
	public static final int BUFFER_SPRITE_MONSTER_5		= 5;
	public static final int BUFFER_SPRITE_MONSTER_6		= 6;
	public static final int BUFFER_SPRITE_ROCKET_1		= 7;
}
